
/*
 * @features: 功能
 * @description: 说明
 * @Date: 2020-12-24 16:41:54
 * @Author: judu233(769471424@qq.com)
 * @LastEditTime: 2021-09-12 15:12:58
 * @LastEditors: judu233
 */

const { ccclass, property } = cc._decorator;
@ccclass
export default class CPiece extends cc.Component {
    nodeBg: cc.Node = null;

    /**改碎片所属的位置序号 */
    indexPos: cc.Vec3 = cc.v3(0, 0);

    /**碎片预备index */
    index: number = 0;

    /**碎片的大小 */
    pieceSize: cc.Size = cc.size(0, 0);

    /**碎片名字 */
    indexName: string;

    /**临时存放拖拽的节点 */
    tempDragNode: cc.Node;

    /**原本的父节点 */
    beforDragNode: cc.Node;

    /**控制当前碎片是否可以点击 */
    isCanClick = true;
    
    /**
     * 初始化
     * @param pieceSize 碎片大小
     * @param indexPos 当前碎片所属的index序列  
     */
    init(pieceSize: cc.Size, indexPos: cc.Vec3, index: number) {
        this.pieceSize = pieceSize;
        this.indexPos = indexPos;
        this.index = index;
    }
}
